<template>
	<view class="detail">
	<text class="title">{{newsDetail.title}}</text>
		<view class="info">
			<text>发表时间:{{newsDetail.add_time | dateFmt}}</text>
			<text>浏览:{{newsDetail.click}}</text>
			
		</view >
		<view class="content">
			<rich-text :nodes="newsDetail.content"></rich-text>
		</view>
	
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsid:0,
				newsDetail:{}
				
			}
		},
		onLoad(options){
			this.newsid = options.id
			this.getNewsDetail()
			console.log(options);
		},
		methods: {
			async getNewsDetail(){
				const res = await this.$myRequest({
					url:'/api/getnew/'+this.newsid
				})
				this.newsDetail = res.data.message[0]
				console.log("res"+this.newsDetail);
				
			}
			
		}
	}
</script>

<style lang="scss">
	.detail{
		font-size: 30rpx;
		padding: 0 20rpx;
		.title{
			text-align: center;
			width: 750rpx;
			display: block;
			margin: 20rpx 0;
			color: #aaaaaa;
			font-size: 35rpx;
		}
		.info{
			display: flex;
			justify-content: space-between;
			
		}
	}

</style>
